function main(defaultParams) {
    debugger
    if (defaultParams.moduleActionType === 'form-save') {
        const self = this;
        // 获取页面列表组件
        const pageListEle = self.$$("page_widget_list_fg538l");
        // 获取列表渲染页实例
        const listRenderView = pageListEle.$$getRenderElement();
        // 获取当前显示的组件，表格或者卡片
        const currentListEle = listRenderView.$$getListElement();
        // 调用刷新方法
        currentListEle.$$refreshData();
        // 插入办理经过数据
        let clueId = defaultParams.callbackParams.data.documentNo;

        let username = api.USER_INFO().name;

        let handleRecord = {
            replyId: clueId,
            recordType: 1,
            recordTitle: "线索登记",
            recordContent: `督办人员${username}登记了个案线索。`,
            relationReplyId: ""
        }

        insertHandleRecord(handleRecord)
    }
}

/**
 * 处理经过
 * @param recordData
 * @returns {Promise<unknown>}
 */
function insertHandleRecord(recordData) {
    return new Promise((resolve, reject) => {
        api.EXEC_FORMULA("API_CALL('ds_api:deef77e2-7e67-4bae-acbd-cbd468cfca82-9e5a', 'userId',USER_ID(), 'result.uid')").then(res => {
            let userId = res.result;
            const insertHandleRecords = [
                ['record_uid', 'UUID()'],
                ['relation_id', `'${recordData.replyId}'`],
                ['record_type', `'${recordData.recordType}'`],
                ['record_title', `'${recordData.recordTitle}'`],
                ['record_content', `'${recordData.recordContent}'`],
                ['create_time', 'NOW()'],
                ['create_human_id', `'${userId}'`],
                ['relation_reply_id', `'${recordData.relationReplyId}'`]
            ];

            const formattedFields = insertHandleRecords.map(([key, value]) => {
                return `'${key}',${value}`;
            });

            const law_std_sup_handle_record = "ds_tbl:t_0ff47ea0e3a74ffdbc274409e7103e7e-9e5a";
            const insertSql = `INSERT('${law_std_sup_handle_record}', [${formattedFields.join(',')}])`;
            console.log(insertSql);


            api.EXEC_FORMULA(insertSql).then(res => {
                console.log(res);
                resolve(res);
            })
        })
    });
}

